﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
///CheckLic 的摘要说明
/// </summary>
public class CheckLic
{
	public CheckLic()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
	}

    public static bool checknow(string path,ref string strMsg)
    {
        
        bool bRet = false;
        QianBaiLicense.License l = new QianBaiLicense.License(path);
        int n = l.CheckCode();

        if (n == 0)
        {
            strMsg = "正常许可";
            bRet = true;
        }
        else if (n == (-1))
        {
            strMsg = "无效许可";
        }
        else if (n == (-2))
        {
            strMsg = "非本机许可";

        }
        else if (n == (-3))
        {
            strMsg = "过期许可";
        }

        return bRet;
    }

}
